home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-03-21 | 42.6 KB | 1,106 lines |
- QLIB VIDEO routines give your programs more control over the
- screen than BASIC allows. You can save and restore screens,
- print on the screen or read from the screen at blinding speed, use
- dual-monitor systems, use "virtual screens", and use screen color
- attributes not availiable with BASIC alone.
-
- Two kinds of QLIB video routines are available: Direct Video Memory
- (DVM), the fastest available, and BIOS, compatible with a wider range of
- hardware and software.
-
- BIOS video routines use the PC's BIOS and are slower than DVM routines,
- but are more compatible with oddball hardware than comparable QLIB DVM
- subroutines. NOTE: "oddball hardware" does not mean the average $1.98
- PC clone. QLIB's DVM subroutines were developed using a cheap XT clone
- with a Hercules-clone graphics card, and work equally well with higher-
- priced equipment. BIOS video subroutines also work in most graphics
- modes, but background colors may not work as expected. To use BIOS
- subroutines in Hercules graphics mode, QBHERC or MSHERC must be loaded.
- On computers which have multiple screen pages (except Hercules), BIOS
- subroutines work with the page set by QLIB's TPage subroutine or
- BASIC's SCREEN command.
-
- Some multi-task software, as well as weird hardware, has problems with
- DVM. With this in mind, several BIOS video subroutines were designed to
- share common calling syntax and function with DVM subroutines, so that
- you may quickly adapt your programs to a variety of situations.
-
- Many of QLIB's video routines support a wide variety of screen
- dimensions. In addition to the standard 40- and 80-column modes,
- EGA 43-row and VGA 50-row text modes are also supported, and users of
- several EGA and VGA systems may also use 132-column text modes at
- QLIB speed. With the Hercules Graphics Card Plus and InColor card,
- 90-column and 43-row modes are available, which work with QLIB's
- video subroutines. If you are using other equipment which allows non-
- standard text modes, call me and I may be able to help you.
-
- DVM video subroutines take advantage of PC video systems' known video
- memory addresses and transfer data directly to video memory instead of
- working through DOS or the PC BIOS. This results in nearly instant
- displays. DVM also provides additional support for the Hercules Graphics
- Card not available otherwise.
-
- Video hardware configurations supported include Monochrome Display Adapter
- (MDA), Color Graphics Adapter (CGA), Hercules Graphics Card, (HGC),
- Hercules Graphics Card Plus (HGC+), Enhanced Graphics Adapter (EGA),
- Everex Micro Enhancer Deluxe EGA (EEGA), Paradise EGA 480 (PEGA),
- MCGA and VGA. I have used QLIB with MDA, MCGA, HGC, HGC+, EGA, EEGA,
- PEGA, and several VGA systems.
-
-
- Most video display systems have much more memory than required to display
- a full screen of text. This additional memory is required when the
- system is used in graphics mode, but it may also be used to advantage in
- text mode. Screen pages may be used to store help screens, to save one
- screen while another is displayed, or to build one screen while another
- is displayed. The table below summarizes QLIB's screen page support
- for various video systems. This should not be considered a complete
- table of information.
-
- system screen size page numbers QuickBASIC/BIOS support
- ------------- ----------- ------------ -----------------------
- MDA 80 x 25 0 yes (1)
- CGA 80 x 25 0 - 3 yes
- CGA, EGA, VGA 40 x 25 0 - 7 yes
- EGA, VGA 80 x 25 0 - 7 yes
- EGA 80 x 43 0 - 3 yes
- VGA 80 x 50 0 - 3 yes
- Super EGA/VGA 132 x 25 0 - 3 limited
- Super EGA/VGA 132 x 43 0 & 1 limited
- HGC 80 x 25 0 - 15 limited (2,3)
- HGC+, InColor 90 x 25 0 - 13 limited (3)
-
- (1) MDA systems have enough memory for only one complete screen, but
- virtual screens (see MakeVScreen) and ScreenSave may be used to
- duplicate the effect of multiple screen pages.
-
- (2) Hercules Graphics Cards and clones have sufficient memory for up
- to 16 screen pages. These are all available if there is no other
- monitor connected to the computer, no RAMFont characters are used
- and the second 32k of Hercules memory is included in the memory map.
- See Use64k.
-
- (3) BIOS subroutines work on page 0 only. BASIC gets confused.
-
- Virtual screens may be used with all video systems. See MakeVScreen.
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: ANSIColor
- object file: anscolor.obj
-
- ANSIColor returns the color attribute used by the ANSI.SYS
- console driver.
-
- Example:
-
- REM $INCLUDE: 'qlib.bi'
- attr% = ANSIColor
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: APrint(st$)
- object file: aprint.obj
-
- Subroutine: APrintN(st$)
- Subroutine: APrintT(st$)
- object file: aprintn.obj
-
- APrint subroutines display the string st$ on the screen using
- ANSI screen colors, begining at the current cursor location. With
- APrint, the cursor is moved to the end of the string. APrintN moves
- the cursor to the beginning of the next line, and APrintT adds a TAB,
- moving the cursor past the end of the string.
-
- Example:
-
- CALL APrint(st$)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: BigPrint(st$, row%, col%, attr%)
- object files: bigprint.obj (q$crt.obj)
-
- BigPrint prints st$ on the screen using characters that are
- eight times larger than normal text. This is handy for attacting
- attention to a display from a distance. Only characters from
- CHR$(0) through CHR$(127) can be used (but I can add CHR$(128) through
- CHR$(255) if you want). Only 10 characters will fit across a standard
- 80-column screen.
-
- Example:
-
- CALL BigPrint(st$, row%, col%, attr%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: BlockFrame(style%, row0%, col0%, row1%, col1%, attr%)
- object file: bframe.obj
-
- BlockFrame is a BIOS version of WindowFrame. See WindowFrame for
- more documentation.
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: Bprint(st$, row%, col%, attr%)
- object file: bprint.obj
-
- Subroutine: BprintL(st$, row%, col%, attr%)
- Subroutine: BprintU(st$, row%, col%, attr%)
- object file: bprintul.obj
-
- These subroutines use BIOS calls to duplicate the functions of
- the Qprint series. See Qprint for more documentation.
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ClearBlock(row0%, col0%, row1%, col1%, attr%)
- object file: scroll.obj
-
- Uses BIOS calls to duplicate the function of WindowClear,
- below. See WindowClear for additional information.
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ClearEOL(attr%)
- object file: cleareol.obj
-
- Uses BIOS calls to clear a row from the current cursor position
- to then edge of the screen using color attr%.
-
- Example:
- CALL ClearEOL(attr%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ClrScreen(attr%)
- object files: clrscrn.obj (q$crt.obj, q$clrw.obj)
-
- ClrScreen uses DVM to clear the video page set by UseTPage to a
- specified color attribute. Color attributes may be calculated using
- ColorATTR.
-
- Example:
- CALL ClrScreen(attr%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: Clock(row%, col%, attr%) (QuickBASIC 4.x only)
- Subroutine: NoClock
- object file: qbclock.obj
-
- Clock prints and maintains a clock display on text-mode
- screens at row row% and column col%, printed with color attribute
- attr%. The clock may be de-activated with NoClock, or may be moved
- by calling clock again. Clock should be de-activated when using
- graphics modes.
-
- Example:
- CALL Clock(1, 1, 14) ' activate clock in upper left corner
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: attr% = ColorAttr(fore%, back%)
- object file: coloratt.obj
-
- Calculates the color attribute (attr%) for many QLIB video
- subroutines. ColorAttr allows use of the "blink" attribute, which may
- also be used for high-intensity backgrounds (See SetBLINK).
-
-
- Default color values for IBM (and compatible) color displays are:
-
- foreground color Value
-
- black 0 Note: Background colors 0-7 are
- blue 1 identical to foreground colors 0-7.
- green 2 Background colors 8-15 are identical
- cyan 3 foreground color 8-15 if Blink has
- red 4 been turned off. If blink is on,
- magenta 5 background colors 8-15 will look like
- brown 6 colors 0-7, and will make the foreground
- "white" 7 blink.
- gray 8
- bright blue 9
- bright green 10
- bright cyan 11
- bright red 12
- bright magenta 13
- yellow 14
- bright white 15
-
- Example:
- REM $INCLUDE: 'qlib.bi'
- REM I want bright red blinking characters on a green background
- fore% = 12: back% = 10
- attr% = ColorAttr(fore%, back%)
-
-
- (continued on next page)
-
- For IBM Monochrome, Hercules and compatible displays:
-
- foreground value appearance
-
- 0 black if background% = 0 or 7
- if background% between 1 and 6,
- normal if bright% = 0
- bright if bright% = 1
-
- 1 underlined, or bright + underline if bright% = 1
-
- 2 - 7 normal, or bright if bright% = 1
-
- background value appearance
-
- 0 - 6 black
- 7 normal color if foreground% = 0
-
- bright if blink% = 1, SetBLINK(0)
- called, and foreground% = 0
-
- black if foreground% <> 0
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: CursorColor(attr%)
- object files: curscolr.obj (q$herc.obj)
-
- CursorColor enables the InColor card's color palette and sets the
- cursor color. If the InColor card in not installed, CursorColor
- does nothing.
-
- Example:
- attr% = 12 ' bright red
- ' legal color attributes are 1-15
- CALL CursorColor(attr%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: CursorON(row%, col%)
- Subroutine: UCursorON(row%, col%)
- Subroutine: CursorOFF
- object file: cursor.obj (q$crt.obj)
-
- CursorON moves the cursor to row%, col%, and makes the cursor
- visible. An underscore cursor is used if the system is in OVERTYPE
- mode, and the cursor is a larger block if the system is in INSERT mode.
- InsertON and InsertOFF (see EQUIP.DOC) will turn the INSERT mode on
- or off. UCursorON makes the cursor visible as an underscore regardless
- of the INSERT toggle. CursorOFF makes the cursor invisible at its current
- location. Unlike BASIC's LOCATE command, CursorON works with PEGA, EEGA
- and HGC+ extended text modes. CursorON should not be used to position
- the cursor for a BASIC PRINT command. To use a text cursor in graphics
- modes, see GCursor in GRAPHICS.DOC.
-
- Example:
- row% = 25: col% = 1
- CALL CursorON(row%, col%)
- REM this put the cursor in the lower left corner of a standard
- REM text screen and turned it on.
- .
- CALL CursorOFF
- REM the cursor is now invisible
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: FillEOL(char%, attr%)
- object file: cleareol.obj
-
- Uses BIOS calls to fill a row from the current cursor position
- to then edge of the screen using character char%, and color attr%.
- Note that char% is the ASCII character code of the character used.
-
- Example:
- CALL FillEOL(ASCII("w"), attr%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: GetANSI(attr%)
- object file: getansi.obj
-
- GetANSI determines the color attribute used by the ANSI device
- driver. Attr% returned by this subroutine may be used to restore the
- screen to the default colors at the end of a program.
-
- Example:
- CALL GetANSI(attr%)
- CALL ClrScreen(attr%)
- END
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: GetCHR(char%, attr%)
- object file: getchr.obj
-
- GetCHR returns the ASCII code char% and color attribute attr% on
- the screen at the current cursor position.
-
- Example:
- CALL GetCHR(char%, attr%)
- PRINT "The character at the current cursor position is " + CHR$(char%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: GetPOS(row%, col%)
- object file: getpos.obj
-
- Uses BIOS calls to determine the current cursor position. Similar
- to QB's col% = POS(x) and row% = CSRLIN commands, but works with non-
- standard text screens.
-
- Example:
- CALL GetPOS(row%, col%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: HRam9025
- object files: hram9025.obj (hmode.obj, q$herc.obj)
-
- Sets Hercules Graphics Card Plus and Hercules InColor cards
- in a 90-column RAMFont mode, using the standard ROM characters, and
- returns a confirmation/error code. Although testing is incomplete,
- most QLIB video subroutines (either DVM or BIOS) should work with this
- mode on page 0. Use GetCRT or FindMono to determine if the HGC+ or
- InColor card is in your system, or declare HRam9025 as a function
- (example 2) and use the return code to determine success. Up to 14
- screen pages are possible with this mode, using QLIB's DVM subroutines.
- See ShowTPage. When using LineEdit in this mode on pages other than
- page 0, do not use the BIOS output option. When restoring the monochrome
- monitor to standard text mode, you must use HText (see GRAPHICS.DOC) or
- your screen will become quite confused, and monitor damage is a
- possiblity (though mine survived the testing).
-
- Example 1:
- CALL HRam9025
-
- Example 2:
- DECLARE FUNCTION HRam9025 ()
- .
- .
- .
- a% = HRam9025: IF a% = 0 THEN PRINT "90-column mode not available"
- REM a% = 144 or greater if successful
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: HRam9043
- object files: hram9043.obj (hmode.obj, q$herc.obj, hload8x8.obj, f8x8.obj)
-
- Function: HRam8043
- object files: hram8043.obj (hmode.obj, q$herc.obj, hload8x8.obj, f8x8.obj)
-
- Similar to HRam9025 above, but sets RamFont cards to 80- or
- 90-column, 43-row mode. HRam8043 and HRam9043 overwrite stored fonts
- with a standard 8x8 character font.
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: HScroll(row0%, col0%, row1%, col1%, attr%, columns%)
- object files: hscroll.obj
- (q$window.obj (q$crt.obj), q$qprn.obj, q$clrw.obj)
-
- A DVM horizontal window scroll routine, scrolling left or right. The
- area scrolled is limited by row0%, col0%, row1%, col1%. Positive values
- of columns% will scroll the window left, negative values scroll the window
- right, and columns% = 0 will blank the window. Columns cleared by the
- scrolling action will be set to color attribute attr%. See also VScroll.
-
- Example:
- row0% = 5: col0% = 10: row1% = 15: col1% = 75: columns% = 1
- CALL HScroll(row0%, col0%, row1%, col1%, attr%, columns%)
- REM we just scrolled a block of the screen one column left
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: pointer% = MakeVScreen(rows%, cols%)
- Subroutine: KillVScreen
- object files: vscreen.obj (q$crt.obj, q$alloc.obj)
-
- MakeVScreen allows QLIB's DVM input and output subroutines to be
- directed to a virtual screen in memory other than video memory.
- MakeVScreen must be called to allocate DOS memory and to establish
- VScreen dimensions before the VScreen can be used. DVM subroutines
- known to work with virtual screens include:
-
- Qprint Qread ClrScreen WindowFrame
- QprintU HScroll ReColorWindow WindowClear
- QprintL VScroll PaintWindow PaintScreen
- QprintCE WindowSave ReColorScreen QprintW
- SaveScreen WindowRestore ScreenSize TLoad
- TSave
-
- VScreens may be used on MDA-equipped computers to duplicate the effects
- possible with multi-page video systems. Call UseTPage with page% = -1
- to direct QLIB's DVM subroutines to the virtual screen. If insufficient
- memory is available for the VScreen, MakeVScreen returns pointer% = 0.
- MakeVScreen also releases any previous VScreen memory before making the
- new VScreen.
- KillVScreen releases the VScreen memory, making it available to the
- BASIC program. After calling KillVScreen, UseTPage with page% = -1
- will make QLIB use a standard monochrome monitor if one is installed.
-
- Example:
-
- REM The computer has only an MDA display, and we want to build a screen
- REM while another is displayed, then pop the virtual screen into view.
-
- REM $INCLUDE: 'qlib.bi'
- CALL ScreenRows(rows%, cols%) ' get screen dimensions
- pointer = MakeVScreen(rows%, cols%) ' establish memory screen
- CALL UseTPage(-1, oops)
- ' QLIB's DVM subroutines will print to the virtual
- ' screen now. The screen may be viewed by copying
- ' to page 0.
- REM Now we want to pop the virtual screen to the display.
- REM Since only one VScreen page is possible, you must call UseTPage
- REM again with page% = 0 otherwise TCopy will not work properly.
- CALL UseTPage(0, oops)
- CALL TCopy(-1, 0, oops)
- .
- .
- .
- REM All done with this virtual screen, so release the memory so
- REM that the BASIC program can use it.
- CALL KillVScreen
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: ModeMono
- Function: ModeColor
- object files: mode.obj (find6845.obj)
-
- ModeMono and ModeColor allow you to switch from monochrome to
- color or color to monochrome monitors if you have a 2-monitor system.
- See EQUIP.DOC to determine what monitors are installed. After using
- ModeMono or ModeColor, the screen will be cleared. QLIB's video
- subroutines will work with either monitor. Be sure to return to the
- original monitor before exiting the program, or QB will get quite
- confused. ModeColor and ModeMono may be used either as functions
- or as subroutines. See examples.
-
- Example 1:
- CALL ModeMono ' if no monochrome monitor is installed, no action
- ' is taken
-
- Example 2:
- DECLARE FUNCTION ModeMono()
- .
- .
- .
- a% = ModeMono: IF a% THEN CALL Qprint("monochrome monitor",1,1,15)
- REM a% = 0 if no monochrome monitor installed
- REM with ModeColor, a% = 0 if no color monitor
- REM if a% = 3, ModeColor was sucessful
- REM if a% = 7, ModeMono was sucessful
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: Mode43
- object file: mode43.obj
-
- Mode43 sets an EGA system in the standard 80-column, 43-row text
- mode (80 column, 50-row mode for VGA). Mode43 may be called as a
- subroutine or can be used as a function returning an error flag (see
- examples). Mode43 may also be used to switch to the EGA monitor in
- 2-monitor systems.
-
- Example 1:
- CALL GetCRT(crt%)
- IF crt% = 1 OR crt% = 3 THEN CALL Mode43
-
- Example 2:
- DECLARE FUNCTION Mode43% ()
- a% = Mode43: IF a% = 0 THEN PRINT "Mode43 not available"
- REM a% = 7 if monochrome EGA/VGA, and a% = 3 if color EGA/VGA
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Function: Mode13243
- Function: Mode13225
- object files: mode132.obj (issevga.obj, egainfo.obj)
-
- Mode13243 and Mode13225 change video modes on supported systems
- to 132-column, 43-row (or 25-row) modes. Mode13243 and Mode13225
- return 0 if no supported video system is installed.
-
- Supported systems are:
-
- Everex Micro Enhancer EGA
- Paradise EGA 480
- Oak VGA (with Super VGA monitor)
- Paradise Plus 16 VGA (with Super VGA monitor)
- Tseng VGA (with Super VGA monitor)
- Western Digital VGA (with Super VGA monitor)
-
- Contact me to include your equipment in this list.
-
-
- QLIB subroutines which have been tested in these modes are:
-
- Qprint ClearBlock WindowRestore WindowFrame
- QprintCE LineEdit PaintWindow WindowClear
- QprintU HScroll ReColorWindow Scroll
- QprintL VScroll ScreenSave ScreenRestore
- CursorON QprintW WindowSave ClrScreen
- CursorOFF Qread ReColorWindow PaintScreen
- PaintWindow ReColorScreen TCopy SetBlink
- ScreenSize BlockFrame Bprint BprintU
- BprintL TLoad TSave GetPOS
- SetPOS MovePOS GetCHR ScreenRows
- ShowTPage UseTPage TPage BigPrint
- APrint (1) APrintN (1) APrintT (1)
-
- (1) A replacement for DOS's ANSI.SYS, such as PC Magazine's ANSI.COM
- may provide superior results with these modes. I can modify
- ANSI.COM to work with your 132-column mode.
-
- BASIC's screen input/output commands, like PRINT and LOCATE, will
- not position the cursor properly in 132 column modes. Use QLIB's
- subroutines instead.
-
- Use ModeColor or Mode43 to return the system to a standard mode.
- If you do not return to a standard mode before ENDing your program,
- it is likely you will end up with an unreadable screen.
-
- Example:
- REM $INCLUDE: 'qlib.bi'
- IF Mode13243 THEN ... ' function success
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: MovePOS(rows%, cols%)
- object file: movepos.obj
-
- Moves the cursor from its present position by rows% rows and cols%
- columns. Rows% and cols% may be positive or negative.
-
- Example:
- rows% = -2 ' move the cursor up two rows
- cols% = 0
- CALL MovePOS(rows%, cols%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: PaintScreen(attr%)
- object files: paint.obj (q$crt.obj, q$paint.obj)
-
- PaintScreen changes the color attribute over the entire screen to
- attr%. Affects only the video page set by UseTPage.
-
- Example:
- CALL PaintScreen(attr%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: PaintWindow(row0%, col0%, row1%, col1%, attr%)
- object files: pwindow.obj (q$window.obj, q$crt.obj, q$paint.obj)
-
- DVM routine which changes the color attribute on a block of the
- active video page defined by row0%, col0%, row1%, col1%. The entire block
- is changed to attr%. Changes color on video page set by UseTPage.
-
- Example:
- row0% = 1: col0% = 1: row1% = 25: col1% = 80
- CALL PaintWindow(row0%, col0%, row1%, col1%, attr%)
- REM we just changed the entire screen to color attr% without
- REM re-printing the text.
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- THE QPRINT SERIES
-
- QuickPRINT DVM routines print a string of text on the screen at very
- high speed. QPRINT routines include built-in LOCATE and COLOR statements,
- and do not affect the cursor position. ALL ASCII characters may be used,
- but QPRINT routines work only in text mode. Color attributes (attr%) may
- be calculated with ColorATTR. UseTPage sets QPRINT's active page (Page 0
- only for MDA).
-
- Subroutine: QCenter(st$, row%, attr%)
- object files: qcenter.obj (q$crt.obj, q$qprn.obj)
-
- Subroutine: QPrint(st$, row%, col%, attr%)
- object files: qprint.obj (q$crt.obj, q$qprn.obj)
-
- Subroutine: QPrintU(st$, row%, col%, attr%)
- Subroutine: QPrintL(st$, row%, col%, attr%)
- object files: qprintul.obj (q$crt.obj)
-
- Subroutine: QPrintCE(st$, row%, col%, attr%)
- object files: qprintce.obj (q$crt.obj, q$qprn.obj, q$clrw.obj)
-
- QPrint, the fastest and most compact of the QPRINT series, will
- meet most needs. QPrintU will print a-z as upper case A-Z, and QPrintL
- will print A-Z as lower case a-z without changing st$. QPrintCE clears
- the screen from the end of st$ to the right edge of the screen. QCenter
- qprints the string centered horizontally on the row specified.
-
- Example:
- st$ = "This is a test of fast screen printing"
- row% = 10: col% = 20
- CALL QPrint(st$, row%, col%, attr%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: QprintVArray(addr%, row0%, col%, attr%, n%)
- object files: qprintva.obj (q$crt.obj, q$qprn.obj)
-
- Subroutine: QprintFArray(segment%, addr%, len(a), row0%, col0%, attr%, n%)
- object files: qprintfa.obj (q$crt.obj, q$qprn.obj)
-
- QprintArray subroutines print n% elements of the string array a$()
- beginning at row0%. The first array element is printed at row0%, col%,
- the second at row0% + 1, col%, and so on. QprintVArray is for arrays of
- normal variable-length strings, and QprintFArray is for arrays of QB4's
- fixed-length strings.
-
- Example 1:
- DIM a$(10) ' 11 array elements, a$(0) through a$(10)
- a$(0) = "This is the first string"
- a$(1) = "This is the second string"
- n% = 5 ' print a$(0) through a$(4)
- row0% = 5: col% = 10
- addr% = VARPTR(a$(0)) ' a$(0) is the first one to be printed
- CALL QprintVArray(addr%, row0%, col%, attr%, n%)
-
- Example 2: (QB4+ only)
- DIM a(10) AS STRING*20 ' 11 array elements, each string 20 bytes
- a(0) = "This is the first string"
- a(1) = "This is the second string"
- n% = 5: row0% = 5: col% = 10: l% = LEN(a(0))
- segment% = VARSEG(a(0))
- addr% = VARPTR(a(0))
- CALL QprintFArray(segment%, addr%, l%, row0%, col%, attr%, n%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: QPrintW(st$, row0%, col0%, row1%, col1%, attr%)
- object files: qprintw.obj
- (q$window.obj, q$crt.obj, q$qprn.obj, q$clrw.obj)
-
- QPrintW adds word wrap to QPrint. Text is confined to a window of
- the screen defined by row0%, col0%, row1%, col1%, and each line of text
- is broken between words unless the word is longer than the width of the
- window, when the word will be broken at the edge of the window. QPrintW
- also clears all parts of the window not occupied by the string. If st$
- is a nul string, QPrintW will clear the window and return to QuickBASIC.
-
- Example:
- st$ = "This is a test of fast screen printing with word wrap"
- row0% = 10: col0% = 20: row1% = 15: col1% = 50
- CALL QPrintW(st$, row0%, col0%, row1%, col1%, attr%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: QRead(st$, row%, col%)
- object files: qread.obj (q$crt.obj)
-
- Uses DVM to read a string of text from the active video page.
- The initial length of st$ determines the length of the string returned
- by QRead. This is like QPrint in reverse.
-
- Example:
- st$ = SPACE$(14)
- row% = 12: col% = 5
- CALL QRead(st$, row%, col%)
- REM st$ is now the first 14 characters on the active video page
- REM beginning at row 12, column 5
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ReColorScreen(oldattr%, newattr%)
- object files: recolor.obj (q$crt.obj)
-
- Replaces oldattr% with newattr%, allowing the programmer to
- selectively change screen colors. Affects only the video page set by
- UseTPage.
-
- Example:
- ReColorScreen(oldattr%, newattr%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ReColorWindow(row0%, col0%, row1%, col1%, oldattr%, newattr%)
- object files: rcwindow.obj (q$window.obj, q$crt.obj, recolor.obj)
-
- Replaces oldattr% color with newattr% in the window defined by
- row0%, col0%, row1%, col1%, without re-printing the contents of the
- window.
-
- Example:
- oldattr% = 7 ' gray on black to be replaced
- newattr% = 14 ' with bright red on black
- row0% = 10: col0% = 1 ' from row 10, column 1
- row1% = 25: col1% = 80 ' to the end of the screen
- CALL ReColorWindow(row0%, col0%, row1%, col1%, oldattr%, newattr%)
-
-
-
- ScreenRows(rows%, columns%)
- object files: scrnrows.obj (q$crt.obj)
-
- ScreenRows allows you to determine the screen's dimensions. Rows
- are the vertical dimension and columns are the horizontal dimension.
-
- Example:
- CALL ScreenRows(rows%, columns%)
- REM a standard 80 x 25 screen returns rows% = 25 and columns% = 80
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ScreenRestore(screenaddr%)
- Subroutine: ScreenSave(screenaddr%)
- object files: screen.obj (q$crt.obj, q$clrw.obj)
-
- Function: ScreenMem
- object files: smem.obj (q$crt.obj, q$alloc.obj)
-
- Uses DVM to save/restore display screen video page set by UseTPage in a
- memory buffer. ScreenMem calculates the amount of memory required to
- store the screen, allocates the memory, and returns the segment address
- of the memory block. Use FreeMem(screenaddr%) to release the memory.
-
- Example:
- REM $INCLUDE: 'qlib.bi'
- screenaddr% = ScreenMem
- CALL ScreenSave(screenaddr%) ' save this screen
- .
- .
- .
- CALL ScreenRestore(screenaddr%) ' bring the screen back
- CALL FreeMem(screenaddr%) ' release the memory block
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: Scroll(row0%, col0%, row1%, col1%, attr%, lines%)
- object file: scroll.obj
-
- Uses BIOS calls to scroll a window of the screen lines% rows,
- limited by row0%, col0%, row1%, col1%. Positive values of lines% will
- scroll the screen up, negative values scroll the screen down, and lines%
- = 0 will blank the window. Rows cleared by the scrolling action will be
- set to color attribute attr%.
-
- Example:
- row0% = 5: col0% = 10: row1% = 15: col1% = 75: lines% = 1
- CALL Scroll(row0%, col0%, row1%, col1%, attr%, lines%)
- REM we just scrolled everything in the window up one row
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: SetBLINK(a%)
- object file: setblink.obj
-
- Enables / disables blinking attributes in text mode. When blinking
- is disabled, blinking reverse video attributes are changed from normal
- intensity backgrounds to high intensity. SetBLINK affects all screen
- pages.
-
- Example:
- a% = 0
- CALL SetBLINK(a%) ' turn blink off, high intensity backgrounds on
- a% = 1
- CALL SetBLINK(a%) ' restore blinking attributes
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: SetPOS(row%, col%)
- object file: movepos.obj
-
- Positions the cursor at row%, col%. Similar to QB's LOCATE row, col
- command, but works with non-standard text screens. Don't use SetPOS to
- position the cursor for a PRINT command.
-
- Example:
- CALL Mode13243 ' use 132-column mode
- row% = 40
- col% = 100
- CALL SetPOS(row%, col%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: ShowTPage(page%, oops%)
- object files: tpage.obj (q$crt.obj, q$herc.obj)
-
- ShowTPage allows you to see screen page number page%. Does
- NOT affect QuickBASIC's PRINT command. NOTE: ShowTPage will not
- work with MDA or standard Hercules equipment. On HGC+, ShowTPage
- works with either HText (pages 0 - 3) or HRam9025 (pages 0 - 2) modes.
- Use QLIB's DVM subroutines to print on all Hercules (standard or HGC+)
- pages, and use CursorON to position the cursor. See also UseTPage and
- TPage. Oops% = -1 if page% is too big, and oops% = 1 if QLIB can
- use the page but can't display it (as with a standard Hercules page).
- If ShowTPage can't show a page, you can use TCopy to copy the page to
- one that can be shown.
-
- Example:
- CALL ShowTPage(page%, oops%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: SnowON
- Subroutine: SnowOFF
- object file: crt.asm
-
- Alters "snow" control used by QLIB's DVM subroutines. QLIB's
- default is SnowON with CGA and MCGA, SnowOFF with other video systems.
- SnowON prevents annoying interference on the screen with older CGA video
- systems. This "snow" control slows QLIB when used with CGA. Many newer
- CGA cards do not have the "snow" problem. SnowOFF disables QLIB's snow
- control logic for maximum speed. Use SnowOFF if the computer is a
- PS/2 model 25 or model 30 with MCGA.
-
-
- Example:
- REM $INCLUDE: 'qlib.bi'
- PRINT "Do you want to disable the snow control?"
- IF YesNo = ASCII("Y") THEN CALL SnowOFF
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: TCopy(frompage%, topage%, oops%)
- object files: tcopy.obj (tpage.obj, q$crt.obj, q$herc.obj, q$clrw.obj)
-
- Similar to BASIC's PCOPY command, TCopy copies one page of video
- memory to another using DVM. This may be used to save screens to recall
- later. Oops% will be set to -1 if frompage% is too big, or -2 if
- topage% is too big. Oops% = 0 if no error. For MDA systems use
- ScreenSave.
-
- All screen pages saved by TCopy are erased when the system is
- changed to or from Graphics mode. (Except when using QLIB's HGraph0
- on Hercules systems. See GRAPHICS.DOC.) Use ScreenSave to save text
- screens before the system is used in Graphics mode. TCopy works in all
- multi-page text modes supported by QLIB.
-
- Example:
- CALL TCopy(frompage%, topage%, oops%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: TLoad(filename$, oops%)
- object files: tsave.obj (q$crt.obj)
-
- TLoad copies a screen file from a disk to video memory. The file
- name passed to TLoad must be an ASCIIZ (zero-terminated) string. Oops%
- returned by TLoad = 0 if no error occurred. See also TSave.
-
- Example:
- filename$ = "helpfile.hlp" + CHR$(0)
- CALL TLoad(filename$, oops%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: TPage(page%, oops%)
- object files: tpage.obj (q$crt.obj, q$herc.obj)
-
- TPage combines the functions of UseTPage and ShowTPage.
-
- Example:
- CALL TPage(page%, oops%)
- REM this is equivalent to
- REM CALL UseTPage(page%, oops%)
- REM CALL ShowTPage(page%, oops%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: TSave(filename$, oops%)
- object files: tsave.obj (q$crt.obj)
-
- TSave copies a text-mode screen to a file. The file name passed
- to TSave must be an ASCIIZ (zero-terminated) string. Oops%
- returned by TSave = 0 if no error occurred. See also TLoad.
-
- Example:
- filename$ = "helpfile.hlp" + CHR$(0)
- CALL TSave(filename$, oops%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: VScroll(row0%, col0%, row1%, col1%, attr%, lines%)
- object files: vscroll.obj
- (q$window.obj, q$crt.obj, q$wcpy.obj, q$clrw.obj)
-
- A DVM vertical window scroll routine. The area scrolled is limited
- by row0%, col0%, row1%, col1%. Positive values of lines% will scroll the
- screen up, negative values scroll the screen down, and lines% = 0 will
- blank the block of the screen. Rows cleared by the scrolling action will
- be set to color attribute attr%. See also HScroll.
-
- Example:
- row0% = 5: col0% = 10: row1% = 15: col1% = 75: lines% = 1
- CALL VScroll(row0%, col0%, row1%, col1%, attr%, lines%)
- REM we just scrolled a block of the screen one row up
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: UseTPage(page%, oops%)
- object files: tpage.obj (q$crt.obj, q$herc.obj)
-
- Sets active video page used by most DVM video routines. See also
- TPage and ShowTPage. Oops% = -1 if page% is too big. Does NOT affect
- BIOS subroutines. If page% = -1, QLIB's DVM subroutines will use
- either a standard 80-column, 25-row monochrome monitor if installed,
- or a 'virtual' screen established by MakeVScreen.
-
- Example:
- page% = 2
- CALL UseTPage(page%, oops%)
- REM Qread, SaveScreen, PaintWindow, ClrScreen,
- REM ClrBlock, VScroll, ReColorWindow, WindowSave, WindowResore,
- REM HScroll and the Qprint series will now use screen page 2.
-
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: WindowClear(row0%, col0%, row1%, col1%, attr%)
- object files: wclear.obj (q$window.obj, q$crt.obj, q$clrw.obj)
-
- Uses DVM to clear a window of the screen from row0%, col0%, to
- row1%, col1%, where row1% > row0%, col1% > col0%. The window may be
- cleared to any color attribute. Color attributes may be calculated
- using ColorATTR.
-
- Example:
- CALL WindowClear(row0%, col0%, row1%, col1%, attr%)
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: WindowFill(row0%, col0%, row1%, col1%, attr%, char%)
- object files: wfill.obj
- (wclear.obj, q$window.obj, q$crt.obj, q$clrw.obj)
-
- Fills an area of the screen with specified character and color
- attribute; this is an alternate entry for the WindowClear subroutine.
-
- Example:
- char% = ASC("■")
- CALL WindowFill(row0%, col0%, row1%, col1%, attr%, char%)
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: WindowFrame(style%, row0%, col0%, row1%, col1%, attr%)
- object files: wframe.obj
- (q$window.obj, q$crt.obj, q$qprn.obj, q$clrw.obj)
-
- WindowFrame draws a box with corners at (row0%, col0%),
- (row0%, col1%), (row1%, col0%), (row1%, col1%). Double lines are used to
- draw the box if style% = -1, single lines if style% = 0. An ASCII
- character may be used instead of single or double lines, if style% is
- an integer from 1 to 255. The border will be made of CHR$(style%).
-
- Example:
- row0% = 5: col0% = 10: row1% = 15: col1% = 75: style% = -1
- CALL WindowFrame(style%, row0%, col0%, row1%, col1%, attr%)
- REM we just drew a box on the screen in color attr%, using
- REM double lines
- .
- .
- .
- style$ = "Yellow"
- style% = ASC(style$)
- CALL WindowFrame(style%, row0%, col0%, row1%, col1%, attr%)
- REM we just replaced the double-lined box with a box bordered
- REM with "Y"
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Subroutine: WindowSave(windowaddr%, row0%, col0%, row1%, col1%)
- Subroutine: WindowRestore(windowaddr%, row0%, col0%, row1%, col1%)
- object files: wsave.obj (q$window.obj, q$crt.obj, q$wcpy.obj)
-
- Function: wsegment% = WindowMem(row0%, col0%, row1%, col1%)
- object files: wsave.obj (q$alloc.obj, q$window.obj, q$crt.obj)
-
- Must compile BASIC source code with /O option
-
- WindowSave is used to copy a block of the screen to an array in order
- to restore the window at a later time with WindowRestore. WindowMem
- calculates the size of the memory block needed to store the window and
- allocates the memory, returning the segment address of the memory block.
-
- Example:
- REM $INCLUDE: 'qlib.bi'
- row0% = 10: col0% = 10: row1% = 20: col1% = 60
- wsegment% = WindowMem(row0%, col0%, row1%, col1%)
- IF wsegment% = 0 THEN ... ' do error handling stuff - could be too big
- CALL WindowSave(wsegment%, row0%, col0%, row1%, col1%)
- .
- .
- CALL WindowRestore(wsegment%, row0%, col0%, row1%, col1%)
- CALL FreeMem(wsegment%) ' release the memory block
-